import { defHttp } from '@/utils/http/axios';

// eslint-disable-next-line ts/unbound-method
const request = defHttp.request;
// 查询公告列表
export async function listNotice(query) {
  return request({
    url: '/article/list',
    method: 'get',
    params: query,
  });
}

// 查询公告详细
export async function getNotice(id) {
  return request({
    url: '/article/selectJyArticleById',
    method: 'get',
    params: { id },
  });
}

// 新增公告
export async function addNotice(data) {
  return request({
    url: '/article/add',
    method: 'post',
    data,
  });
}

// 修改公告
export async function updateNotice(data) {
  return request({
    url: '/article/edit',
    method: 'put',
    data,
  });
}
export async function updateNoticeStatus(id, status) {
  return request({
    url: `/article/edit/${id}/${status}`,
    method: 'put',
  });
}

// 删除公告
export async function delNotice(noticeId) {
  return request({
    url: `/article/delete/${noticeId}`,
    method: 'delete',
  });
}
